import socket
HOST = "127.0.0.1"
HOST = "10.68.113.103"
PORT = 80

se = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
se.connect((HOST,PORT))

d = '''GET / HTTP/1.1  
'''

# s.send(d.encode("utf-8"))
se.send("GET / HTTP/1.1\n".encode("utf-8"))
se.send("Accept:text/html,application/xhtml+xml,*/*;q=0.8\n".encode("utf-8"))
#se.send("Accept-Encoding:gzip,deflate,sdch\n")
se.send("Accept-Language:zh-CN,zh;q=0.8,en;q=0.6\n".encode("utf-8"))
se.send("Cache-Control:max-age=0\n".encode("utf-8"))
se.send("Connection:keep-alive\n".encode("utf-8"))
se.send(("Host:"+HOST+"\r\n").encode("utf-8"))
se.send("Referer:http://www.baidu.com/\n".encode("utf-8"))
se.send("user-agent: Googlebot\n\n".encode("utf-8"))

r = se.recv(1024)
print("r:", r.decode("utf-8"))

# host="www.baidu.com"
# se=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
# se.connect((host,80))
# se.send("GET / HTTP/1.1\n".encode("utf-8"))
# se.send("Accept:text/html,application/xhtml+xml,*/*;q=0.8\n".encode("utf-8"))
# #se.send("Accept-Encoding:gzip,deflate,sdch\n")
# se.send("Accept-Language:zh-CN,zh;q=0.8,en;q=0.6\n".encode("utf-8"))
# se.send("Cache-Control:max-age=0\n".encode("utf-8"))
# se.send("Connection:keep-alive\n".encode("utf-8"))
# se.send(("Host:"+host+"\r\n").encode("utf-8"))
# se.send("Referer:http://www.baidu.com/\n".encode("utf-8"))
# se.send("user-agent: Googlebot\n\n".encode("utf-8"))
# print(se.recv(1024))